package cybertechcebu.task
{
	import flash.events.Event;

	public class TaskEvent extends Event
	{
		public static const TASK_START:String = "taskStart";
		public static const TASK_END:String = "taskEnd";
		public static const TASK_PROGRESS:String = "taskProgress";
		public static const TASK_ERROR:String = "taskError";

		private var _error:String;
		private var _progress:String;
		private var _result:Boolean = false;
		
		public function TaskEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
		{
			super(type, bubbles, cancelable);
		}
		
		public function get error():String{
			return _error;
		}
		public function set error(mesg:String):void{
			_error = mesg;
		}
		public function get progress():String{
			return _progress;
		}
		public function set progress(mesg:String):void{
			_progress = mesg;
		}
		
		public function get result():Boolean{
			return _result;
		}
		
		public function set result(result:Boolean):void{
			_result = result;
		} 

		override public function clone():Event
		{
			var event:TaskEvent = new TaskEvent(type, bubbles, cancelable);
			event.error = _error;
			event.progress = _progress;
			event.result = _result;
			return event;
		}
	}
}
